﻿using Game;
namespace Mekiasm
{
    public class ElectricFoodMachineWidget : BaseEnergyWidget
    {
        public ComponentEnergyMachine Component;
        public ElectricFoodMachineWidget(ComponentEnergyMachine machine, ComponentMiner miner) : base(miner)
        {
            Component = machine;
            MoreBox.IsVisible = true;
            mekProgress.IsVisible = true;
            if (machine is ComponentElectricCook) setTitle("烹饪机");
            if (machine is ComponentElectricDrink) setTitle("饮料制作机");
        }
        public override void Update()
        {
            SetPowerProgress((float)Component.Power / Component.MaxPower);
            SetLeftBottomMoreInfo($"消耗: {ILibrary.FormatPowerUse(Component.OutputPowerLimit)}\n当前:{ILibrary.FormatPower(Component.Power)}\n最大:{ILibrary.FormatPower(Component.MaxPower)}");
            base.Update();
        }

    }
}
